<template>
  <div id="inTellingSchedule">
    <el-container>
      <el-header class="inTellingScheduleHeader">
        <div class="inTellingScheduleHeaderBtn">
          <router-link to="/constructionPlan"> 施工计划 </router-link>
        </div>
        <div class="inTellingScheduleHeaderBtn">进度管理</div>
        <div class="title">智慧生产管控数字化平台</div>
        <div class="inTellingScheduleHeaderBtn">过程质检</div>
        <div class="inTellingScheduleHeaderBtn">档案管理</div>
      </el-header>
      <el-main class="inTellingScheduleMain">
        <!-- <div class="inTellingScheduleMainLeft">
          <div class="inTellingScheduleMainLeftTop">
            <div id="centreLeft1Chart"></div>
          </div>
          <div>
            <div id="centreLeft1Chart2"></div>
          </div>
          <div></div>
        </div>
        <div class="inTellingScheduleMainMiddle"></div>
        <div class="inTellingScheduleMainRight"></div> -->
        <!-- <sm-viewer>
          <sm3d-measure></sm3d-measure>
        </sm-viewer> -->
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "inTellingSchedule",
  data() {
    return {
      options: {},
    };
  },
  computed: {},
  props: {},
  mounted() {
    // this.loadEcharts1();
    // this.loadEcharts2();
    this.initialize();
  },
  methods: {
    loadEcharts1() {
      var myChart = this.$echarts.init(
        document.getElementById("centreLeft1Chart")
      );
      let option = {
        title: {
          text: "施工进度",
          // left: "center",
          top: "top",
          textStyle: {
            fontSize: 20,
            color: "#fff",
          },
        },

        textStyle: {
          color: "#fff",
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            // Use axis to trigger tooltip
            type: "shadow", // 'shadow' as default; can also be 'line' or 'shadow'
          },
        },
        legend: {
          // Try 'horizontal'

          right: 10,
          top: "top",
          left: "center",
          textStyle: {
            fontSize: 10,
            color: "#fff",
          },
        },
        grid: {
          left: "3%",
          right: "3%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: {
          type: "value",
        },
        yAxis: {
          type: "category",
          data: ["1月", "2月", "3月", "4月", "5月"],
          textStyle: {
            color: "#fff",
          },
        },
        series: [
          {
            name: "完成",
            type: "bar",
            stack: "total",
            itemStyle: {
              color: "#3f95c2",
            },
            label: {
              show: true,
            },
            emphasis: {
              focus: "series",
            },
            data: [60, 40, 50, 30, 60],
          },
          {
            name: "未完成",
            type: "bar",
            stack: "total",
            itemStyle: {
              color: "#89dcf6",
            },
            showBackground: true,
            backgroundStyle: {
              color: "rgba(180, 180, 180, 0.2)",
            },
            label: {
              show: true,
              color: "white",
            },
            emphasis: {
              focus: "series",
            },
            data: [40, 60, 50, 70, 40],
          },
        ],
      };
      option && myChart.setOption(option);
    },
    loadEcharts2() {
      var myChart = this.$echarts.init(
        document.getElementById("centreLeft1Chart2")
      );
      let option = {
        tooltip: {
          trigger: "item",
        },
        legend: {
          top: "5%",
          left: "center",
        },
        series: [
          {
            name: "Access From",
            type: "pie",
            radius: ["40%", "70%"],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 10,
              borderColor: "#fff",
              borderWidth: 2,
            },
            label: {
              show: false,
              position: "center",
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 40,
                fontWeight: "bold",
              },
            },
            labelLine: {
              show: false,
            },
            data: [
              { value: 150, name: "总计划" },
              { value: 200, name: "任务进度" },
            ],
          },
        ],
      };
      option && myChart.setOption(option);
    },
    initialize() {
      console.log(1);
      var viewer = new Cesium.Viewer("cesiumContainer");
      //使用本地的一张图片初始化地球，建议图片长宽比2:1
      viewer.imageryLayers.addImageryProvider(
        new Cesium.SingleTileImageryProvider({
          url: "./images/worldimage.jpg",
        })
      );
      console.log(viewer);
    },
  },
};
</script>
<style lang="less" scoped>
#inTellingSchedule {
  width: 100%;
  height: 100%;
  background-color: rgba(16, 16, 16, 0.3);
  .inTellingScheduleHeader {
    display: flex;
    justify-content: space-between;
    width: 80%;
    margin: 0 auto;
    padding: 0.5rem 20rem;
    .title {
      color: rgb(140, 162, 170);
      font-size: 34px;
      font-family: AlibabaPuHui;
      font-weight: 500;
      line-height: 48px;
    }
    .inTellingScheduleHeaderBtn {
      color: white;
    }
  }
  .inTellingScheduleMain {
    width: 100%;
    height: 100%;
    .inTellingScheduleMainLeft {
      width: 30%;
      .inTellingScheduleMainLeftTop {
        #centreLeft1Chart {
          width: 90%;
          height: 250px;
          margin: 0 auto;
        }
      }
    }
  }
}
</style>
